import React from 'react';

function showStatus(status) {
    if(status==0){
        return '预付费用户'
    }else if(status==1){
        return '后付费用户'
    }else{
        return '无限制'
    }
}
const ProductList = ({infoObj,getProductDetail}) => {

    return (
        <div className="product-card" onClick={getProductDetail} id={infoObj.id}>
            <img src={require('../public/images/produts.png')}  id={infoObj.id} alt="pic"/>
            <div>
                <p className="card-title mxw-100 ellipsis"  id={infoObj.id} >{infoObj.name}</p>
                <p  id={infoObj.id}>{showStatus(infoObj.user_restrict)}</p>
            </div>
        </div>
    );
};

export default ProductList;

